﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ADC.BL;
using System.Text;

namespace ADC.Web
{
    public partial class ZHome : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            BindFocusTravel();
        }

        private void BindFocusTravel()
        {

            // Bind focus travel
            var focusTravels = FocusTravelFactory.GetAll();

            if (focusTravels.Count < 0) return;
            StringBuilder strFocusTravel = new StringBuilder();
            for (int i = 0; i < focusTravels.Count; i++)
            {



                if (i == focusTravels.Count - 1)
                {
                    strFocusTravel.Append("<a style='color:White; text-decoration:none ' href='/Home.aspx?ID=");
                    strFocusTravel.Append(focusTravels[i].focustravelID);
                    strFocusTravel.Append("' >");
                    strFocusTravel.Append(focusTravels[i].Name);
                    strFocusTravel.Append("</a>");
                }
                else
                {
                    strFocusTravel.Append("<a style='color:White; text-decoration:none ' href='/Home.aspx?ID=");
                    strFocusTravel.Append(focusTravels[i].focustravelID);
                    strFocusTravel.Append("' >");
                    strFocusTravel.Append(focusTravels[i].Name);
                    strFocusTravel.Append(" </a>&nbsp;&nbsp;&nbsp;<span style='color: white'>|</span>&nbsp;&nbsp;&nbsp;");

                }
            }

            lblFocusTravel.Text = strFocusTravel.ToString();


            // Bind destination

            var focusDestinations = FocusDestinationFactory.GetAll();

            if (focusDestinations.Count < 0) return;
            StringBuilder strFocusProgram = new StringBuilder();
            for (int i = 0; i < focusDestinations.Count; i++)
            {

                if (i == focusDestinations.Count - 1)
                {
                    strFocusProgram.Append("<a style='color:White; text-decoration:none ' href='/FocusVNDestination.aspx?ID=");
                    strFocusProgram.Append(focusDestinations[i].FocusDestinationID);
                    strFocusProgram.Append("' >");
                    strFocusProgram.Append(focusDestinations[i].Name);
                    strFocusProgram.Append("</a>");
                }
                else
                {
                    strFocusProgram.Append("<a style='color:White; text-decoration:none ' href='/FocusVNDestination.aspx?ID=");
                    strFocusProgram.Append(focusDestinations[i].FocusDestinationID);
                    strFocusProgram.Append("' >");
                    strFocusProgram.Append(focusDestinations[i].Name);
                    strFocusProgram.Append("</a>&nbsp;&nbsp;&nbsp;<span style='color: white'>|</span>&nbsp;&nbsp;&nbsp;");

                }
            }

            //lblDestinations.Text = strFocusProgram.ToString();

        }
    }
}